<%@include file="/WEB-INF/jsp/common/header.jsp" %>

<script>
    $(document).ready(function() {

        //MAIN FORM
        //Click Save button


        $("a.add-small").click(function() {
            $("#country-add-form").submit();
        });
    });
</script>
<div id="Content">
    <div class="metadata">


        <c:if test="${country.id==null}">
            <h2><spring:message code="administration.country.create"/></h2>
        </c:if>
        <c:if test="${country.id!=null}">
            <h2><spring:message code="administration.country.modify"/></h2>
        </c:if>
        <a class="back action-link" href="./list.html"><spring:message code="back"/></a>

        <c:if test="${country.id!=null}">
            <a class="cancel action-link" href="./delete.html?id=${country.id}"><spring:message code="delete"/></a>
        </c:if>

    </div>
    <div class="post">
        <div class="entry">
            <div>
                <h2><spring:message code="administration.country.information"/></h2>
            </div>

            <div>
                <table >
                    <thead>
                    <tr>
                        <div class="form-line">
                            <th class="col_A">
                                    <spring:message code="column.name"/>
                            </th>
                            <th class="col_A">
                                    <spring:message code="culture"/>
                            </th>
                            <th class="col_A">
                            </th>

                        </div>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${countryLocal}" var="i">
                        <tr>
                            <td class="col_A">${i.name}</td>
                            <td class="col_A">${i.cultureName}</td>
                            <td class="col_A"></td>
                        </tr>
                    </c:forEach>

                    <tr>
                        <form:form id="country-add-form" action="./addLocal.html"  modelAttribute="country" method="POST">
                        <div class="form-line">
                            <td class="col_A">
                                <form:input cssClass="store-input" path="name"/><span class="mandatory">*</span>
                                <form:errors path="name" cssClass="error"/>
                            </td>
                            <td class="col_A">
                                <form:select cssClass="select" path="cultureId">
                                    <form:option value=""></form:option>
                                    <form:options items="${cultures}" itemValue="id" itemLabel="name"/>
                                </form:select><span class="mandatory">*</span>
                            </td>
                            <td class="col_A"><a class="add-small action-link-small" href="javascript:void(0)"/></td>
                        </div>
                             <c:if test="${country.id!=null}">
                                <form:hidden path="id"/>
                            </c:if>
                        </form:form>
                    </tr>
                    </tbody>

                </table>
            </div>

        </div>
    </div>

</div>


<%@include file="/WEB-INF/jsp/common/footer.jsp" %>